FROM php:7.4

ENV COMPOSER_ALLOW_SUPERUSER 1

RUN apt-get update && \
    apt-get install -y zip unzip openssl curl wget git && \
    curl -sS https://getcomposer.org/installer | php && \
    mv composer.phar /usr/local/bin/composer && \
    composer self-update --clean-backups

WORKDIR /opt/ConfigConterClient

COPY ./app ./app
COPY ./bootstrap ./bootstrap
COPY ./config ./config
COPY ./database  ./database
COPY ./public  ./public
COPY ./resources  ./resources
COPY ./routes ./routes
COPY ./artisan ./
COPY ./composer.* ./
COPY ./*.php ./
COPY ./.env.example ./.env

RUN mkdir -p storage/app && \
    mkdir -p storage/framework/views && \
    mkdir -p storage/framework/cache && \
    mkdir -p storage/framework/sessions && \
    composer install --no-dev -o && \
    rm -f ./.env
CMD php artisan configCenter:start

